\typeout{Document style `EuLisp/Kluwer'  - May 89, July 92, February 93}

% July 92.
% various changes and deletions to integrate eulisp.sty with iso.sty
% from NPL.  Now document style is [eulisp]{iso}.

% February 93.
% dumped lots of stuff so we can input into the kluwer style but still
% get some of the layout features of the definition.

\makeatletter

% BEGIN RATIONALE/DEFINITION/PRIVATE STUFF
% The following business was written with the help of CQ and JHD.
% Unfortunately, I stil can't work out how to make it into an
% environment comand--get runaway argument, end of file during ...

% JAP -- Le macro suivant e'te' pique' du ficher ApocaLIXP.sty
%
%        ignorer l'entr\'ee jusqu'au motif #1
% Le motif doit \^etre dans le m\^eme fichier !
\def\ignoretill#1{\begingroup
   \long\def\ignoretill##1#1{\endgroup}\ignoretill}

\newif\ifRationale
\newif\ifDefinition
\newif\ifPrivate

\Rationalefalse
\Definitionfalse
\Privatefalse

\def\beginRationale{\begingroup
  \ifRationale\let\endRationale=\endgroup\begingroup
  \else\aftergroup\ignoretill\aftergroup\endRationale\fi\endgroup}

\def\beginDefinition{\begingroup
  \ifDefinition\let\endDefinition=\endgroup\begingroup
  \else\aftergroup\ignoretill\aftergroup\endDefinition\fi\endgroup}

\def\beginPrivate{\begingroup
  \ifPrivate\let\endPrivate=\endgroup\begingroup
  \else\aftergroup\ignoretill\aftergroup\endPrivate\fi\endgroup}

% END RATIONALE/DEFINITION/PRIVATE STUFF

% BEGIN RANDOM TRIVIAL DEFINITIONS

\def\level{level-88}

\def\module{undefined-module}

\def\undefmod{undefined-module}

\def\is{& \rm ::= &}

\def\myrelax#1,{\relax}

%\def\telos{{\small T}{\scriptsize E$\Lambda$O$\Sigma$}}
\def\telos{{\small T}{\scriptsize ELOS}}
\def\TELOS{$TE\Lambda O\Sigma$}
\def\lisp{{\small L}{\scriptsize ISP}}
\def\lelisp{{\small L}{\scriptsize E}{\small -}\lisp}
\def\LELISP{{Le-Lisp}}
\def\lelispxv{{\small L}{\scriptsize E}{\small -}\lisp\ {\scriptsize v. 15}}
\def\lelispxvi{{\small L}{\scriptsize E}{\small -}\lisp\ {\scriptsize v. 16}}
\def\mceyx{$\mu${\small C}{\scriptsize EYX}}
\def\EULISP{{\Large E}{\normalsize U}{\Large L}{\normalsize ISP}}
\def\eulisp{{\small E}{\scriptsize U}\lisp}
\def\feel{{\small F}{\scriptsize EEL}}
%\def\cl{{\small C}{\scriptsize OMMON}\lisp}
\def\cl{Common Lisp}
\def\interlisp{{\small I}{\scriptsize nter}\lisp}
\def\smalltalk{{\small S}{\scriptsize MALL}{\small T}{\scriptsize ALK}}
\def\clos{{\small CLOS}}
\def\loops{{\small L}{\scriptsize OOPS}}
\def\oaklisp{{\small O}{\scriptsize AK}\lisp}
\def\flavors{{\small F}{\scriptsize LAVORS}}
\def\self{{\small S}{\scriptsize ELF}}
\def\smeci{{\small SMECI}}
\def\aida{{\small AIDA}}
\def\asquell{{\small ASQUELL}}
\def\classic{{\small CLASSIC}}
\def\complice{{\small C}{\scriptsize OMPLICE}}
\def\ool{object-oriented language}
\def\ools{object-oriented languages}
\def\OOL{Object-Oriented Language}
\def\OOLS{Object-Oriented Languages}
\def\Cpp{C\raise.22ex\hbox{+}\raise.22ex\hbox{+}}
\def\CC2{\mbox{C\hspace{-.05em}\raisebox{.4ex}{\tiny\bf ++}}}
\def\v#1{{\small \lelisp\ version 1#1}}
\def\lelispxv{\v5}
\def\lelispxvi{\v6}
\def\elsy{{\tt ELSY}}
\def\llmt{{\small LLM$_3$}}
\def\llmq{{\small LLM$_4$}}
\def\miel{{\small MIEL}}
\def\xvxvi{{\small XVXVI}}

% For making list of alternations in the formal syntax

\def\choiceaux#1,#2,{\ifx#2\thend #1\let\next=\myrelax
\else #1 $|$\let\next=\choiceaux\fi \next#2,}
\def\choice#1{{\rm \{}\choiceaux#1,\thend,{\rm \}}}

\def\oneofaux#1,#2,{\ifx#2\thend #1\let\next=\myrelax
\else #1 $|$\let\next=\oneofaux\fi \next#2,}
\def\oneof#1{\oneofaux#1,\thend,}

%\def\optional#1{\verb?[?#1\/\verb?]?}
\def\optional#1{{\tt[}#1\/{\tt]}}%

%\def\group#1{\verb?(?#1\/\verb?)?}
\def\group#1{{\tt(}#1\/{\tt)}}%

%
%% \lispindent is the left margin for Lisp programs
%% \lispbeforehook is called before producing the Lisp program
%% \lispafterhook is called after the Lisp program is produced
%% \lispeveryline is called at the beginning of each new line
%% \lispfont is the font used for Lisp programs
% Hooks are generally used to encapsulate the Lisp programs paragraph
% in a figure or a with a different size font or to display line numbers.
%
\def\lispfont{\tt}
\def\lispcommentfont{\it}% unsltt
\def\systemfont{\bf}%      sltt ?
\def\userfont{\tt}

\newdimen\lispindent \lispindent=0cm%
\def\lispbeforehook{\smallskip\@@par\noindent}
\def\lispbegineveryline{\relax}
\def\lispendeveryline{\relax}
\def\lispafterhook{\smallskip\@@par}
\def\lispfont{\tt}
\newif\iffirstlisppar
%
\def\beginlisp{\begingroup\lispbeforehook
   \let\restart=\@@lisp
   \def\verbatimpar{\relax}\global\firstlisppartrue
   \def\par{\verbatimpar}\obeylines
   \def\endlisp{\@@par\lispafterhook\endgroup}\relax
   \rightskip\z@\leftskip\@totalleftmargin
   \advance\leftskip by\lispindent
   \parindent\z@\parfillskip\@flushglue
   \parskip\z@\itemsep=\z@\parsep=\z@\@@lisp}
\def\@@lisp{\begingroup
   \def\verbatimpar{\iffirstlisppar
      \global\firstlispparfalse\lispbegineveryline\else
      \lispendeveryline\@@par\leavevmode\lispbegineveryline\fi}\relax
   \def\endlisp{\lispendeveryline\endgroup\endlisp}\frenchspacing
   \lispverbatim\enablespaces\enablelispcomment
   \enabletex\enablebackslash\enablemacros
   \lispfont}
%  How to recognize comments that begin with a precise character
\def\lispcommentsign{;}
{\catcode`\;=\active
 \gdef\enablelispcomment{\catcode`\;=\active
    \def;{\lispcomment}}\relax
 \gdef\disablelispcomment{\catcode`\;=\other
    \def;{\lispcommentsign}}}

\def\lispcomment{\endgroup\begingroup
   \def\verbatimpar{\ifmmode$\fi\endgroup\restart\verbatimpar}\relax
   \def\endlisp{\ifmmode$\fi\endgroup\endlisp}\relax
   \lispfont\lispcommentsign\@lispcomment}
%% this is a special macro to handle sucessions of lispcommentsign
\def\@lispcomment#1{\relax
  \if\lispcommentsign#1\lispcommentsign\let\temp=\@lispcomment\else
    \ifcat\space#1\let\temp=\@lispcomment
    \else\lispcommentfont\let\temp=#1\fi\fi\temp}
%
% Used to number lines of code
% \numlisp{starting-number}
% (define foo
%         true ) \endnumlisp
\newcount\lisplinenumber \lisplinenumber=1%
\def\numlisp#1{\begingroup
  \lisplinenumber=#1\relax
  \def\endnumlisp{\endlisp\endgroup}\relax
  \def\showlinenumber{\relax
    \ifnum\lisplinenumber<10\ \ \else
    \ifnum\lisplinenumber<100\ \fi\fi
    {\it\the\lisplinenumber}\relax
    \global\advance\lisplinenumber by1\ }\relax
  \def\lispbegineveryline{\showlinenumber}\relax
  \lisp}

%
%    Lorsque l'on appelle \lispverbatim, elle d\'efinit
%    \endlispverbatim comme son inverse.
%
\chardef\other=12\relax
\def\lispverbatim{\relax
 \edef\disablebackslash{\catcode`\noexpand\\=\the\catcode`\\}\relax
 \edef\endlispverbatim{\relax
 \catcode`\noexpand\\=\the\catcode`\\\relax
 \catcode`\noexpand\ =\the\catcode`\ \relax
 \catcode`\noexpand\{=\the\catcode`\{\relax
 \catcode`\noexpand\}=\the\catcode`\}\relax
 \catcode`\noexpand\$=\the\catcode`\$\relax
 \catcode`\noexpand\&=\the\catcode`\&\relax
 \catcode`\noexpand\#=\the\catcode`\#\relax
 \catcode`\noexpand\%=\the\catcode`\%\relax
 \catcode`\noexpand\~=\the\catcode`\~\relax
 \catcode`\noexpand\_=\the\catcode`\_\relax
 \catcode`\noexpand\^=\the\catcode`\^\relax}\relax
 \let\do=\@makeother\dospecials}
\def\disablebackslash{\apocaerror{No disablebackslash here}}

%
%    Pour avoir des blancs qui comptent
%
{\obeyspaces\gdef\enablespaces{\obeyspaces\let \@xobeysp}}
% devrait tenir compte de la taille de la police
\def\gluantspace{\relax
  \spaceskip=.5em plus .25em minus.15em\relax
  \xspaceskip=.5em plus .25em minus.15em}

%
%    Echappement vers TeX, on revient
%    au mode pr\'ec\'edent par \]
%
\def\enabletex{\relax
   \def\[{\endgroup\begingroup
          \def\]{\endgroup\restart}}}

%
%    Pour avoir des \ en sortie
%
\def\enablebackslash{\relax
   \def\\{\char`\\}}

%
%    Permettre les macros
%
\def\enablemacros{\catcode`\\=0\relax}
\def\disablemacros{\catcode`\\=\other}

% NEW \cite MACRO grace a CQ
% A cite macro that allows line breaks within it and notify in the
% text the missing citation.
%
\def\@citex[#1]#2{\relax
  \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi 
  \def\@citea{}\relax
  \@cite{\@for\@citeb :=#2\do
         {\@citea 
          \def\@citea{,\penalty\@m\ }\relax
          \@ifundefined{b@\@citeb }{{\bf ??\@citeb??}\relax
             \@warning{Citation `\@citeb ' on page \thepage
                          \space undefined}}\relax
          {\csname b@\@citeb \endcsname}}}{#1}}

% OPERATOR DESCRIPTION HEADINGS

\def\category#1#2#3{\medskip\noindent%
\hbox to\hsize{\hbox{\group{\verb?#1? {\em #2}}}\hfill\hbox{\bf #3}}}%

\def\cat#1#2#3{\smallskip\noindent%
\hbox to\hsize{\hbox{\group{\verb?#1? {\em #2}}}\hfill\hbox{\bf #3}}}%

\def\signature#1#2#3#4{\medskip\noindent%
\hbox to\hsize{\hbox{\group{\verb?#1? {\em #2}} $\rightarrow$ {\em #3}}\hfill\hbox{\bf #4}}}%
\def\lsignature#1#2#3#4{\medskip\noindent%
\hbox to\hsize{\vbox{\hbox{\group{\verb?#1? {\em #2}} $\rightarrow$ {\em #3}}\hfill\hbox{\bf #4}}}}%

\def\sig#1#2#3#4{\noindent%
\hbox to\hsize{\hbox{\group{\verb?#1? {\em #2}} $\rightarrow$ {\em #3}}\hfill\hbox{\bf #4}}}%

\def\tabsig#1#2#3{\noindent%
\group{\verb?#1? {\em #2}} $\rightarrow$ {\em #3}}%

\def\syntax#1{\medskip\noindent%
\hbox to\hsize{\hbox{\verb?#1?}\hfill\hbox{\bf \level\ syntax}}}%
\def\stx#1{\noindent%
\hbox to\hsize{\hbox{\verb?#1?}\hfill\hbox{\bf \level\ syntax}}}%

\def\level{level-88}

% END RANDOM TRIVIAL DEFINITIONS

% BEGIN CATEGORY HEADING STUFF

% hack to get the style I want for language element entries

\def\@mystartsectiona#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
   \par \@tempskipa #4\relax \@afterindenttrue \ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse\fi \if@nobreak
\everypar{}\else \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}{\@dblarg{\@mysecta{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@mysecta#1#2#3#4#5#6[#7]#8#9{\ifnum #2>\c@secnumdepth
     \def\@svsec{}\else\def\@svsec{}\fi
%     \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\hskip 0.5em }\fi
     \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@
        \begingroup #6\relax\vbox{%
          \vskip5pt\vfil\hrule height.3mm%
          \@hangfrom{\hskip #3\relax\@svsec}%
             {\interlinepenalty \@M \hbox{\tt #8}\hfill\hbox{\em #9}\par}%
          \vskip5pt\vfil\hrule height.3mm}%
        \endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    {\tt #7}}\else
        \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
                      {#7}\addcontentsline
                           {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       {\tt #7}}}\fi
     \@xsect{#5}}

\def\@mystartsectionb#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
   \par \@tempskipa #4\relax \@afterindenttrue \ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse\fi \if@nobreak
\everypar{}\else \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}{\@dblarg{\@mysectb{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@mysectb#1#2#3#4#5#6[#7]#8#9{\ifnum #2>\c@secnumdepth
     \def\@svsec{}\else\def\@svsec{}\fi
%     \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\hskip 0.5em }\fi
     \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@
        \begingroup #6\relax\vbox{%
          \vskip5pt\vfil\hrule height.3mm%
          \@hangfrom{\hskip #3\relax\@svsec}%
             {\interlinepenalty \@M \hbox{\em #8}\hfill\hbox{\em #9}\par}%
          \vskip5pt\vfil\hrule height.3mm}%
        \endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    {\em #7}}\else
        \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
                      {#7}\addcontentsline
                           {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       {\em #7}}}\fi
     \@xsect{#5}}

\newcounter{entry}[subsection]
\def\theentry {\thesubsection .\arabic{entry}}
\def\l@entry{\@gobbletwo}
\def\entrymark#1{}

\def\entry#1#2{\@mystartsectiona
    {entry}{3}{\z@}{2ex plus 1ex minus .2ex}{.1ex plus .1ex}
    {\normalsize\bf}%
    {#1}{#2}}
\def\metaentry#1#2{\@mystartsectionb
    {entry}{3}{\z@}{2ex plus 1ex minus .2ex}{.1ex plus .1ex}
    {\normalsize\bf}%
    {#1}{#2}}

\def\runinentry#1{\subsubsection*{#1}}

\def\function#1{\entry{#1}{\level\ function}}
\def\setter#1{\entry{(setter #1)}{\level\ setter}}
\def\generic#1{\entry{#1}{\level\ generic function}}
\def\method#1{\entry{#1}{\level\ method}}
\def\condition#1#2{\entry{<#1>}{#2}}
\def\syntaxform#1{\entry{#1}{\level\ syntax}}
\def\metasyntaxform#1{\entry{#1}{\level\ syntax}}
\def\keyword#1{\entry{#1}{\level\ special form}}
\def\metakeyword#1{\entry{#1}{\level\ special form}}
\def\macro#1{\entry{#1}{\level\ macro}}
\def\defform#1{\entry{#1}{\level\ defining form}}
\def\constant#1#2{\entry{#1}{#2}}
\def\class#1{\entry{<#1>}{\level\ class}}

\def\syntax{\subsubsection*{Syntax}}

\def\argumentlabel#1{{\it #1}\/:}
\def\arguments{\subsubsection*{Arguments}\list{}{
       \let\makelabel\argumentlabel}}
\let\endarguments\endlist

\def\initoptionhelper#1,#2,{{\tt{}#1}{\it{}#2}\/:}
\def\initoptionlabel#1{\initoptionhelper#1,}
\def\initoptions{\subsubsection*{Init-options}\list{}{
       \let\makelabel\initoptionlabel}}
\let\endinitoptions\endlist

\def\optionhelper#1,#2,{{\tt{}#1}{\em{}#2}\/:}
\def\optionlabel#1{\optionhelper#1,}
\def\options{\list{}{
       \let\makelabel\optionlabel}}
\let\endoptions\endlist

\def\genargshelper#1,#2,{\ifx#2\thend\let\next=\relax{\it{}#1\thinspace:}
\else\let\next=\myrelax{\tt({\it{}#1}{}#2)}\thinspace:\fi\next}
\def\genargslabel#1{\genargshelper#1,\thend,}
\def\genericargs{\subsubsection*{Generic Arguments}\list{}{
       \let\makelabel\genargslabel}}
\let\endgenericargs\endlist

\def\specargslabel#1{\genargshelper#1,\thend,}
\def\specargs{\subsubsection*{Specialized Arguments}\list{}{
       \let\makelabel\specargslabel}}
\let\endspecargs\endlist

\def\result{\subsubsection*{Result}}
\def\remarks{\subsubsection*{Remarks}}
\def\examples{\subsubsection*{Examples}}
\def\seealso{\subsubsection*{See~also:}}

%------------------------------------------------------------------------

% END CATEGORY HEADING STUFF

\def\objectclass{{\tt <object>}}
\def\structureobjectclass{{\tt <structure>}}
\def\conditionclass{{\tt <condition>}}
\def\characterclass{{\tt <character>}}
\def\stringclass{{\tt <string>}}
\def\numberclass{{\tt <number>}}
\def\integerclass{{\tt <integer>}}
\def\fpintclass{{\tt <fixed-precision-integer>}}
\def\floatclass{{\tt <float>}}
\def\doublefloatclass{{\tt <double-float>}}
\def\symbolclass{{\tt <symbol>}}
\def\nullclass{{\tt <null>}}
\def\pairclass{{\tt <pair>}}
\def\vectorclass{{\tt <vector>}}
\def\tableclass{{\tt <table>}}
\def\threadclass{{\tt <thread>}}
\def\lockclass{{\tt <lock>}}
\def\streamclass{{\tt <stream>}}
\def\structureobjectclass{{\tt <structure>}}
\def\functionclass{{\tt <function>}}

\def\classclass{{\tt <class>}}
\def\metaclass{{\tt <metaclass>}}
\def\abstractclass{{\tt <abstract-class>}}
\def\structureclass{{\tt <structure-class>}}
\def\conditionclassclass{{\tt <condition-class>}}

\renewcommand{\textfraction}{.1}
\renewcommand{\topfraction}{.9}
\renewcommand{\bottomfraction}{.1}
\renewcommand{\floatpagefraction}{.9}

\def\subdefinition#1{\@startsection{subdefinition}{3}{\z@}{2ex plus 1ex minus
   .2ex}{-.5em plus -.1em minus -.1em}{\normalsize\bf}%
   {\protect{\normalsize\bf#1:\thinspace}}}
\def\subdefinitionmark#1{}

\def\clause#1{\subsection{#1}}

\def\index#1{}
\def\subindex#1#2{}
\def\ttindex#1{}
\def\ttsubindex#1#2{}
\def\indexcondition#1{}
\def\indexmodule#1{}
\def\indexconstant#1#2#3{}

\newcounter{globalnote}
\newif\if@globalnotes \@globalnotesfalse
\def\globalnotes{\@globalnotestrue}

\newenvironment{note}{\@ifnextchar[{\@isonote}{\@isonote[]}}{\par\normalsize}
\def\@isonote[#1]{\small\par
NOTE \if@globalnotes\refstepcounter{globalnote}\theglobalnote
     \else#1\fi\relax --- }

% hack replacement for Kluwer's definition macro

\def\definition#1{\@startsection{}{4}{\z@}{
     2ex plus 1ex minus .2ex}{-.5em plus -.1em minus
     -.1em}{\normalsize\bf}%
     {\protect{\normalsize\bf#1:\thinspace}}}

\makeatother
